# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         demo4.16
# Description:
# Author:       $赵怡蕾
# Date:         2019/1/28
#-------------------------------------------------------------------------------

numbers = [1,2,3,4,5,6,7,8,9]
# 步长为-2，从索引为8的元素开始一直到索引为3的元素，运行结果：[9, 7, 5]
print(numbers[8:2:-2])
print(numbers[8:2:-1])                # 步长为-1，运行结果：[9, 8, 7, 6, 5, 4]
print(numbers[1:6:0])                 # 步长为0，会抛出异常